Add options to ignore shared/managed Plex clients#31738
Merged
Conversation
balloob
reviewed
Feb 11, 2020
Contributor
Author
|
If anyone else is willing to validate these changes before we merge, I'd really appreciate it. I'm not certain that this will work in every Plex installation. |
d981935 to
8a7b838
Compare
This comment has been minimized.
This comment has been minimized.
8a7b838 to
a41ebcc
Compare
Contributor
Author
|
Updating this PR to use the new multi-select config option UI when that's available (home-assistant/frontend#4247 / #31798). Still WIP for now. |
a41ebcc to
24a43ad
Compare
balloob
reviewed
Feb 18, 2020
balloob
reviewed
Feb 18, 2020
Kane610
reviewed
Feb 18, 2020
Member
Kane610
left a comment
There was a problem hiding this comment.
Smaller comments from me, looks good!
balloob
approved these changes
Feb 19, 2020
| mock_plex_server = MockPlexServer(load_users=False) | ||
|
|
||
| MOCK_SERVER_ID = MOCK_SERVERS[0][config_flow.CONF_SERVER_IDENTIFIER] | ||
| hass.data[config_flow.DOMAIN] = { |
Member
There was a problem hiding this comment.
Here we're mocking integration code. It would be more robust to just patch the library server and set up the integration so we don't need to mock our own code.
Contributor
Author
There was a problem hiding this comment.
Agree, but there are currently no tests which actually set up the integration. I'd like to do that in the future.
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
The Plex integration currently adds every visible Plex client as a separate
media_playerentity. This makes some installations very unwieldy as large number of shared clients are dynamically created.This PR allows you to choose which Plex users' players will create
media_playerentities via the integration's config options.It also adds an option (YAML and config option) which ignores shared & managed users as they're granted access to the Plex server.
All clients will still be counted by the integration's
sensorfor currently playing sessions.Type of change
Example entry for
configuration.yaml:Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale: